home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / docs / howto / server-info / allspice.debug.me < prev    next >
Encoding:
Text File  |  1992-12-14  |  6.8 KB  |  202 lines

  1. .uh "How to Boot Allspice"
  2. .pp
  3. I am ``Allspice'', Sprite's root file server.  To boot after a power-up try
  4. .(l
  5. >b sd()new
  6. .)l
  7. to boot from disk.  If this hangs or doesn't work for some reason, you may
  8. have to do a network boot from ginger:
  9. .(l
  10. >b ie(0,961c,43)sun4.md/new
  11. .)l
  12. If you get a ``phase error'' when booting off the disk, you need to
  13. reset the bus and try again.  To reset the bus, try booting from a
  14. non-existent disk, e.g.,
  15. .(l
  16. >b sd(0,6)new
  17. .)l
  18. If you don't want allspice to be the root server, use the -backup flag:
  19. .(l
  20. >b ie(0,961c,43)sun4.md/new -backup
  21. .)l
  22. To reboot when running Sprite, use the shutdown command.
  23. .(l
  24. % sync
  25. % shutdown -R 'ie(0,961c,43)sun4.md/new
  26. .)l
  27. The ``sync'' command writes out the cache; it isn't required unless
  28. you are paranoid.  Shutdown will sync the disks as the last thing before
  29. rebooting.
  30. .pp
  31. If Allspice is too wedged to get things done with user commands,
  32. then sync the disks with:
  33. .(l
  34. break-W
  35. .)l
  36. This should print a message about queuing a call to sync the disks,
  37. and when it is done it should print a ``.'' and a newline.
  38. If you don't get the newline then Allspice is deadlocked inside the
  39. file system cache, sigh.
  40. .pp
  41. (Note: on a regular Sun keyboard, this would be L1-W, and you'd use
  42. the L1 key like a shift key.  On a regular ASCII terminal, like
  43. Allspice's console, you use the break key like escape: break then N.)
  44. .pp
  45. You can abort Allspice with:
  46. .(l
  47. break-A
  48. .)l
  49. And then use the boot command described above.
  50.  
  51. .uh "Debugging Tips"
  52. .pp
  53. The current procedure for an Allspice crash is to take a core dump
  54. and then reboot.
  55. .pp
  56. If Allspice acts up then you might try the following things.
  57. If you aren't logged in, log in as root.
  58. Useful commands are:
  59. .(l
  60. allspice # rpcstat -srvr
  61. .)l
  62. Which dumps out the status of all the RPC server processes.  If a bunch
  63. are ``busy'', and they remain busy with the same RPC ID and client, then
  64. there may be a deadlock.
  65. If they are all in the ``wait'' state it means that the Rpc_Daemon process
  66. is not doing rebinding for some reason.
  67. .(l
  68. allspice # ps -a
  69. .)l
  70. This will tell you if any important daemons have died.  In particular,
  71. verify that arpd, ipServer, portmap, unfsd, inetd, tftpd, bootp, lpd,
  72. and sendmail are still around.
  73. If the ipServer is in the DEBUG state you can kill it and
  74. the daemons that depend on it with /hosts/allspice/restartIPServer.
  75. .(l
  76. % rpcecho -h \fIhostname\fP -n 1000
  77. .)l
  78. This program, which is found in /sprite/src/benchmarks/rpcecho,
  79. and may or may not be installed in /sprite/cmds,
  80. will tell you if there timeouts when using the RPC protocol to
  81. talk to another host.  If you suspect that a host with an Intel
  82. ethernet interface is flaking out, you can try this command.
  83. Lot's of timeouts indicate trouble.
  84. You can reset a host's network interface from its console with
  85. .(l
  86. break-N
  87. .)l
  88. .pp
  89. If RPCs to Allspice are hanging but there's no obvious sign of
  90. trouble, the problem might be that the timer queue is wedged.  To
  91. verify that this is the problem, type
  92. .(l
  93. break-T
  94. .)l
  95. This will give the current time (as a number) and the time that
  96. elements of the timer queue are supposed to be processed, sorted by
  97. increasing time.  You may need to use ctrl-S to freeze the display
  98. (use ctrl-Q to unfreeze it).  If the current time is greater than the
  99. earliest element in the timer queue, the timer is wedged and needs
  100. prodding.  To prod the timer, type
  101. .(l
  102. break-A
  103. .)l
  104. to go to the PROM monitor, and then type ``c'' to continue back to
  105. Sprite.  If this fails to unwedge the timer, you should reboot.
  106. .uh "Kernel Debugging"
  107. .pp
  108. If Allspice is so hung you can't explore with user commands,
  109. then the best you can do is sync the disks with:
  110. .(l
  111. break-W
  112. .)l
  113. Then throw Allspice into the debugger with:
  114. .(l
  115. break-D
  116. .)l
  117. If this drops you into the monitor (the '>' prompt), you can
  118. still get into the debugger by typing 'c' to the monitor.
  119. You may have to do this twice.  You should eventually get
  120. a message about ``Entering the debugger...''.
  121. .pp
  122. You have to run the debugger from shallot or another sun4 unix machine, unless
  123. there is a stand-alone Sprite machine available.  To login to shallot, you
  124. can use ginger's console, next to you, on top of
  125. ginger.
  126. You should verify that Allspice is accessible by running
  127. .(l
  128. ginger% kmsg -v allspice
  129. .)l
  130. This should return the kernel version that Allspice is running.
  131. If this times-out then either Allspice isn't in the debugger,
  132. or more likely, no one is responding to ARP requests for Allspice's
  133. IP address.  Run the setup-arp script that is in ~sprite bin:
  134. .(l
  135. ginger% setup-arp
  136. .)l
  137. Now rlogin to shallot and run the Sprite kernel debugger.
  138. The kernel images should be copied to ginger:/home/ginger/sprite/kernels
  139. (visible as /home/ginger/sprite/kernels on shallot),
  140. and their version number should be
  141. evident in their name, e.g. sun4.1.065.  If not, you can run
  142. strings on the kernel images and grep for ``VERSION''.
  143. .(l
  144. shallot% strings /tmp/sprite/sun4.sprite | egrep VERSION
  145. .)l
  146. To run the kernel debugger.  (kgdb.sun4 is in ~sprite/cmds.sun4.)
  147. .(l
  148. shallot% cd /home/ginger/sprite/kernels
  149. shallot% Gdb sun4.\fIversion\fP
  150. .)l
  151. If the RPC system seems to be the problem, you can dump the
  152. trace of recent RPCs by calling Rpc_PrintTrace(numRecs)
  153. .(l
  154. (kgdb) print Rpc_PrintTrace(50)
  155. .)l
  156. If there is a deadlock you can dump the process table:
  157. .(l
  158. (kgdb) print Proc_Dump()
  159. .)l
  160. or, if you want to look at only waiting processes:
  161. .(l
  162. (kgdb) print Proc_KDump()
  163. .)l
  164. You can switch from process to process and to stack backtraces
  165. by using the 'pid' command.  You only need to specify the last
  166. two hex digits of the process ID.  If you only have a decimal ID,
  167. then you have to type the whole thing.
  168. File system deadlocks center around locked handles, usually.
  169. When you find a process stuck in Fsutil_HandleFetch of Fsutil_HandleLock
  170. you can try to find the culprit by looking at the *hdrPtr these
  171. guys are waiting on.  There is a 'lockProcessID' in the hdrPtr that
  172. is really the address of a Proc_ControlBlock.  You can print this out
  173. with something like:
  174. .(l
  175. (kgdb) print *(Proc_ControlBlock *)(hdrPtr->lockProcessID)
  176. .)l
  177. You can reboot Allspice from within kgdb with the reboot command.
  178. .(l
  179. (kgdb) reboot ie(0,9634)sun4.md/new
  180. .)l
  181. .uh "Taking a core dump"
  182. .pp
  183. Step 1) Make sure Allspice is in the debugger. If not, put it in the debugger.
  184. .pp
  185. Step 2) Login to ginger.  Go to a file system with > 40 megabytes free
  186. space, e.g., /home/ginger/cores (now /export1/cores).
  187. .pp
  188. Step 2.5) You might need to run ~sprite/cmds.sun3/setup-arp for ginger to 
  189. be able to talk with allspice.
  190. .pp
  191. Step 3) Run kgcore as follows: "~sprite/cmds.sun3/kgcore -v allspice"
  192. The -v is optional but I like it because it prints progress messages.
  193. Note that this step can take several (~ 5) minutes.
  194. .pp
  195. Step 4) Rename the file "vmcore" so something more meaningful such as 
  196. "mv vmcore vmcore.allspice.crash.11-21".   
  197. .pp
  198. Step 5) Reboot allspice.  (~sprite/cmds.sun3/kmsg -R "sd()new" allspice)
  199. .uh "Modify date"
  200. .pp
  201. These notes were last updated by Mike Kupfer on \*(td.
  202.